package com.aispeech.asr.comm.data.pojo;

import lombok.NonNull;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;

@Document("lasr_offline_audios")
public class OldAudioDoc {
    @MongoId
    private String id;

    @NonNull
    private String productId;
    @NonNull
    private String fid;
    @NonNull
    private String audioType;
    @NonNull
    private int sampleRates;
    @NonNull
    private int channel;
    @NonNull
    private int sampleBytes;
    @NonNull
    private int total;
    private int slices = 0;

    private String publicUrl;

    public static OldAudioDoc copyFrom(AudioDoc audioDoc) {
        OldAudioDoc oldAudioDoc = new OldAudioDoc();

        oldAudioDoc.id = audioDoc.getId();
        oldAudioDoc.productId = audioDoc.getProductId();
        oldAudioDoc.fid = audioDoc.getFid();
        oldAudioDoc.publicUrl = audioDoc.getPublicUrl();
        oldAudioDoc.audioType = audioDoc.getAudioType().toUpperCase();
        oldAudioDoc.sampleRates = audioDoc.getSampleRates();
        oldAudioDoc.channel = audioDoc.getChannel();
        oldAudioDoc.sampleBytes = audioDoc.getSampleBytes();
        oldAudioDoc.total = audioDoc.getTotal();

        return oldAudioDoc;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getFid() {
        return fid;
    }

    public void setFid(String fid) {
        this.fid = fid;
    }

    public String getAudioType() {
        return audioType;
    }

    public void setAudioType(String audioType) {
        this.audioType = audioType;
    }

    public int getSampleRates() {
        return sampleRates;
    }

    public void setSampleRates(int sampleRates) {
        this.sampleRates = sampleRates;
    }

    public int getChannel() {
        return channel;
    }

    public void setChannel(int channel) {
        this.channel = channel;
    }

    public int getSampleBytes() {
        return sampleBytes;
    }

    public void setSampleBytes(int sampleBytes) {
        this.sampleBytes = sampleBytes;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSlices() {
        return slices;
    }

    public void setSlices(int slices) {
        this.slices = slices;
    }

    public String getPublicUrl() {
        return publicUrl;
    }

    public void setPublicUrl(String publicUrl) {
        this.publicUrl = publicUrl;
    }
}
